<link type="text/css" rel="stylesheet" href="css/ui/Calendar.css" media="screen" />
<link type="text/css" rel="stylesheet" href="css/productOrder.css" media="screen" />
<style>
#contactList{margin-bottom:10px; background:#f3faff; padding:10px;}
#contactList li{ float:left; margin-right:20px; width:80px; text-align:center}
#contactList li input{vertical-align:-2px; margin-right:2px;}
</style>
<div class="clay"> 
		<input type="hidden" id="remaindMoney" value="<?=$v['money']?>"/>
		<input type="hidden" id="remainTmoney" value="<?=$v['tmoney']?>"/>
		<input type="hidden" id="minbuytnum" value="<?=$p_info['buy_limit_low']?>"/>
		<input type="hidden" id="pay" value="<?=$p_info['pay']?>"/>
		<input type="hidden" id="tourist_info" value="<?=$land_f_info['tourist_info']?>"/>
		<!-- <form action="formSubmit_dev.php" method="post" name="group"> -->
		<form action="admin/pppp.php" method="post" name="group">
			<input type="hidden" name="pid" id="pid" value="<?=$pid?>"/>
			<input type="hidden" name="aid" id="aid" value="<?=$aid?>"/>
			<h2>
				<a target="_blank" href="scenicDetail.html?lid=<?=$p_info['lid']?>&did=<?=$memberID?>"><?=$p_info['ltitle']?></a>
			</h2>
			<div class="proBd">
				<div class="contactW ">
					<h3 class="title">
						<span class="title">预订信息</span>
					</h3>
					<div class="box">
						<div class="ticketlist">
							<?php if($p_info['p_type']=="C"):?>
                                <?php $leavetime=date("Y-m-d",strtotime($begintime)+24*3600);?>
								<p class="roomType line">
									<span class="lTitle">房间类型：</span>
									<?=$p_info['ttitle']?>
								</p>
								<p class="rooms line">
									<span class="lTitle"><i class="red">*</i>预订间数：</span>
									<select id="roomNum" name="tnum">
										<?php for($j=$buynum;$j<=20;$j++):?>
										<option value="<?=$j?>"><?=$j?>间</option>
										<?php endfor;?>
									</select>
								</p>
								<p class="playtime line">
									<span class="lTitle"><i class="red">*</i>入住日期：</span>
									<input type="text" name="begintime" id="begintime" class="inputText" value="<?=$begintime?>"/>
									<span class="lTitle"><i class="red">*</i>离店日期：</span>
									<input type="text" name="leavetime" id="leavetime" class="inputText" value="<?=$leavetime?>"/>
								</p>
								<ul class="priceItem">
									<li style="display:none">
										<input type="hidden" value="<?=$uprice?>"/>
										<div class="priItem">
											<span>¥<?=$uprice?></span>
											<input type="hidden" class="tnum" value="<?=$buynum?>"/>
										</div>
									</li>
								</ul>
							<?php else:?>
								<p class="playtime line">
									<?php if($p_info['p_type']=="A"||$p_info['p_type']=="B"||$p_info['p_type']=="F"):?>
									<span class="lTitle"><i class="red">*</i>游玩日期：</span>
									<input type="text" name="begintime" id="begintime" class="inputText" value="<?=$begintime?>"/>
									(<?=$timeTitle?>)
									<?php elseif($p_info['p_type']=="D"):?>
									<input type="hidden" name="begintime" id="begintime" class="inputText"  value="<?=$begintime?>"/>
									<?php endif;?>
								</p>
								<table id="tbTickets" class="listCon proTable type<?=$p_info['p_type']?>" style="width:100%;">
									<thead>
										<tr>
											<th class="list_1">产品名称</th>
											<th>产品库存</th>
											<th class="price">门市价</th>
											<th class="price">建议零售价</th>
											<th class="price">结算价</th>
											<th>预订数量</th>
											<th>小计</th>
										</tr>
									</thead>
									<tbody>
										<?php foreach($products as $row):?>
										<tr class="line <?=++$pn>3?"more display_none":""?>">
											<td class="list_1 list"><?=$row['ttitle']?></td>
											<td><em class="storage_<?=$row['pid']?>">--</em></td>
											<td class="list_2 list"><em class="price">¥<?=(int)$row['tprice']?></em></td>
											<td class="list_2 list"><em class="price jprice uprice_<?=$row['pid']?>">¥<?=$row['uprice']/100?></em></td>
											<td class="list_3 list"><em class="price jprice tprice_<?=$row['pid']?>">¥<?=$row['jsprice']/100?></em></td>
											<td class="list_4 list">
												<input type="hidden" class="tprice_<?=$row['pid']?>" value="<?=$row['jsprice']/100?>"/>
												<div class="jiajian">
													<a href="#" class="jian jjBtn J_jianBtn minus">减一张</a>
													<input type="text" id="<?=$row['id']?>" name="<?=$row['name']?>" value="<?=$row['buynum']?>" p_minTime="<?=$row['minTime']?>" p_minbuy="<?=$row['buy_limit_low']?>" class="input_text tnum">
													<a href="#" class="jia jjBtn J_jiaBtn add">加一张</a>
												</div>
											</td>
											<td class="list_6 list totalprice">¥<em class="subtotal"><?=$row['buynum']*$row['jsprice']/100?></em></td>
										</tr>
										<?php endforeach;?>
									</tbody>
								</table>
								<?php if(count($products)>3):?>
								<p class="addTicket">
									<a class="fr show_more">显示所有门票类型</a>
								</p>
								<?php endif;?>
							<?php endif;?>
						</div>
						<div class="clear"></div>
						<?php if($ass_station=unserialize($land_f_info['ass_station'])):?>
						<p class="line">
							<span class="lTitle"><i class="red">*</i>集合地址：</span>
							<select name="assembly">
							<?php foreach($ass_station as $key=>$station):?>
							<option value="<?=$key?>"><?=$station?></option>
							<?php endforeach;?>
							</select>
						</p>
						<?php endif;?>
					</div>
				</div>
                <div id="RecommendProducts" class="contactW"></div>
				<div class="contactW ">
					<h3 class="title">
						<span class="title">联系人信息</span>（请准确填写联系人信息，我们将向联系人手机发送订单短信）
						<span class="save"><input type="checkbox" checked value="1" name="saveTo" class="inputText"/>保存到常用联系人</span>
					</h3>
					<div class="box">
					<?php if(count($cinfos)>0):?>
						<div id="contactList">
							<ul>
								<?php foreach($cinfos as $cname=>$cmobile):?>
								<li>
									<input type="checkbox" value="<?=$cmobile?>">
									<span class="name"><?=$cname?></span>
								</li>
								<?php endforeach;?>
							</ul>
							<p class="cl"></p>
						</div>
						<?php endif;?>
						<p class="line">
							<span class="lTitle"><i class="red">*</i>联系人：</span>
							<input type="text" class="inputText" id="ordername" autocomplete="off" name="ordername"/>
						</p>
						<p class="line">
							<span class="lTitle"><i class="red">*</i>手机号码：</span>
							<input type="text"  class="inputText" id="ordertel" name="ordertel">
							(接收订单短信，请务必正确填写)
						</p>
						<p class="line">
							<span class="lTitle">备注信息：</span>
							<input type="text" style="width:400px"  class="inputText" id="memo" name="memo">
						</p>
						<?if($m_info['cname']&&$m_info['ctel']){
							$cname=explode("|",$m_info['cname']);
							$ctel=explode("|",$m_info['ctel']);
						?>
						<div class="contactWrap" id="contactWrap">
							<div class="content">
								<a class="closebtn"></a>
								<h4>您可以选择以下常用联系人：</h4>
								<ul>
								<?for($i=count($cname)-1;$i>=0;$i--){
									if(!$cname[$i]) continue;
								?>
									<li>
										<input type="checkbox" value="<?=$ctel[$i]?>" />
										<span class="name"><?=$cname[$i]?></span>
									</li>
								<?}?>
								</ul>
								<p class="clear">&nbsp;</p>
							</div>
						</div>
						<?}?>
					</div>
				</div>
				<div class="">
					<h3 class="title"><span class="title">供应商信息</span></h3>
					<div class="box orderinfo">
						<p>
							<span>供应商名称：<?=$a_info['dname']?></span>
							<?php if($a_info['qq']):?>
							<span>QQ：<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<?=$a_info['qq']?>&site=qq&menu=yes"><img onerror="this.parentNode.removeChild(this)" style="vertical-align:-5px" border="0" src="http://wpa.qq.com/pa?p=2:<?=$a_info['qq']?>:52" alt="点击这里给我发消息" title="点击这里给我发消息"/></a></span>
							<?php endif;?>
							<span>联系人：<?=$a_info['cname']?> <?=$a_info['mobile']?></span>
						</p>
					</div>
				</div>
				<?php if($land_f_info['p_type']=='C'):?>
				<div class="guest">
					<h3 class="title"><span class="title">入住信息</span></h3>
					<div class="box roomInfo">
						<?php if($land_f_info['tourist_info']>0):?>
						<p class="line">
							<span class="lTitle"><i class="red">*</i>入住人姓名：</span>
							<span class="roomDiv">
								<input type="text" class="inputText roomer gray" id="roomer" name="tourist_name_1" value="入住人1"/>
								<span class="ts">(请填写实际入住人姓名，每个房间只需填1位)</span>
							</span>
						</p>
						<?php endif;?>
						<div class="clear"></div>
						<p class="arriveTime line">
							<span class="lTitle"><i class="red">*</i>最晚到店：</span>
							<select class="" name="arriveTime" id="arriveTime">
								<option value="">请选择时间</option>
								<option>15:00</option>
								<option>16:00</option>
								<option>17:00</option>
								<option>18:00</option>
								<option>19:00</option>
								<option>20:00</option>
								<option>21:00</option>
								<option>22:00</option>
								<option>23:00</option>
								<option>24:00</option>
								<option>次日1:00</option>
								<option>次日2:00</option>
								<option>次日3:00</option>
								<option>次日4:00</option>
								<option>次日5:00</option>
							</select>
						</p>
					</div>
				</div>
				<?php elseif($land_f_info['tourist_info']>0):?>
				<div class="contactW ">
					<h3 class="title"><span class="title">旅客信息</span>（儿童证件号码请填写出生日期）</h3>
					<div class="box tourist">
						<?php if($land_f_info['tourist_info']==1):?>
						<div class="info">
							<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
							<span>
								<select class="tourist_type" style="display:none">
									<option value="1">成人</option>
								</select>
							</span>
							<span>
								<label class="lt"><i class="red">*</i>姓名:</label>
								<input type="text" name="tourist_name_1" class="tourist_name">
							</span>
							<span>
								<label class="lt"><i class="red">*</i>身份证号:</label>
								<input type="text" name="tourist_cert_1" class="tourist_cert" >
							</span>
						</div>
						<?php else:?>
                            <?php for($i=1;$i<=$buynum;$i++):?>
                            <div class="info">
                                <span>第<?=$i?>位游客</span>
                                <span>
                                    <select class="tourist_type">
                                        <option value="1">成人</option>
                                        <option value="0">儿童</option>
                                    </select>
                                </span>
                                <span>
                                    <label class="lt"><i class="red">*</i>姓名:</label>
                                    <input type="text" name="tourist_name_<?=$i?>" class="tourist_name">
                                </span>
                                <span>
                                    <label class="lt"><i class="red">*</i>身份证号:</label>
                                    <input type="text" name="tourist_cert_<?=$i?>" class="tourist_cert" >
                                </span>
                            </div>
                            <?php endfor;?>
						<?php endif?>
					</div>
				</div>				
				<?php endif;?>
				<div class="contactW ">
					<h3 class="title"><span class="title">支付方式</span></h3>
					<div class="box">
						<?php if($p_info['apply_did']==$memberID):?>
						<p style="padding-left:20px;">预订自供产品，无需支付</p>
						<input type="hidden" value="3" name="paymode"/>
						<?php else:?>
						<p class="line pmodel" style="padding-left:20px;">
							<input class="paymode" type="radio" name="paymode" <?=$paymodeCheck2?> value="2" >	
							<span class="credit">授信余额<label> (可用<em class="money">¥<?=$v['tmoney']/100?></em>)</label></span>
							</br>
							<input class="paymode" type="radio" value="0" <?=$paymodeCheck0?> name="paymode">
							<span>账户余额<label> (可用<em class="money">¥<?=$v['money']/100?></em>)</label></span>
							 </br>
							<input class="paymode" type="radio" value="1" <?=$paymodeCheck1?> name="paymode">
							<span>在线支付</span>
						</p>
						<?php endif;?>
					</div>
				</div>
				
			</div>
			<div class="totalCount">
				<p class="con"> 
					<a href="#" class="submitBtn"></a>
					<i class="icon"></i>
					<?php if($p_info['p_type']!="C"):?>
					<span class="span1">门票数：<em id="sumtnum" class="num"><?=$buynum?></em>张</span>
					<?php endif;?>
					<span class="span2">总金额：<em id="summoney" class="num"><?=$buynum*$jsprice/100?></em>元</span>
				</p>
			</div>
			<div class="about">
				<h3 class="title"><span class="title">预订须知</span></h3>
				<div class="content">
					<h3>购票需知：</h3>
					<?=nl2br($p_info['jqts'])?>
					<h3>产品说明：</h3>
					<?=$tips?>
					<h3>取票信息：</h3>
					<?=$p_info['getaddr']?>
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/html" id="tourist_tmpl">
	<div class="info">
		<span>第{:num}位游客</span>
		<span>
			<select class="tourist_type">
				<option value="1">成人</option>
				<option value="0">儿童</option>
			</select>
		</span>
		<span>
			<label class="lt"><i class="red">*</i>姓名:</label>
			<input type="text" name="tourist_name_{:num}" class="tourist_name">
		</span>
		<span>
			<label class="lt"><i class="red">*</i>身份证号:</label>
			<input type="text" name="tourist_cert_{:num}" class="tourist_cert" >
		</span>
	</div>
</script>
<script type="text/html" id="pri_tmpl">
	<li>
		<div class='title'> {:date}({:weekT})</div>
		<input type="hidden" value="{:jsprice}"/>
		<div class="priItem">
			<span>¥{:jsprice}</span></br>
			<span>{:roomStatus}</span>
			<input type="hidden" class="tnum" value="{:tnum}"/>
		</div>
	</li>
</script>
<script type="text/html" id="roomer_tmpl">
	<input type="text" class="inputText roomer more gray" name="tourist_name_{:i}" value="入住人{:i}"/>
</script>
<script type="text/javascript" src="js/jquery.getareas.js" type="text/javascript"></script>
<script type="text/javascript" src="js/global/Date_func.js"></script>
<script type="text/javascript" src="js/ui/JsTpl.js"></script>
<script type="text/javascript" src="js/ui/PopWindow.js"></script>
<script type="text/javascript" src="js/form/Verify.js"></script>
<?php if($p_info['p_type']=="C"):?>
	<script type="text/javascript" src="js/ui/Calendar_hotel.js"></script>
<?php else:?>
	<script type="text/javascript" src="js/ui/Calendar.js"></script>
<?php endif;?>
<script type="text/javascript" src="js/productOrder.js"></script>

<?php if($p_info['p_type']=='F'):?>
<script>
    <? include '/var/www/html/new/d/module/link_product/child_tickets.js';?>
</script>
<?php else:?>
<script>
    <? include '/var/www/html/new/d/module/link_product/link_product.js';?>
</script>
<?php endif;?>